package com.example.entity;

import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class House {
    @Value("房子")
    private String openDoor;

    //空调属性
    @Qualifier("zhongyang")
    @Resource
    private AirConditioner ac;

    //电视属性
    @Qualifier("cwei")
    @Resource
    private TV tv;
    public House(){}

    //注入电视和空调对象
    public House(AirConditioner ac,TV tv){
        this.ac=ac;
        this.tv=tv;
    }
    //开门方法
    public void open(){
        System.out.println(openDoor+"门已经打开");
        //调用方法

    }
    public String getOpenDoor(){
        return openDoor;
    }
    public void setOpenDoor(String door){
      this.openDoor=openDoor;
    }

    public AirConditioner getAc() {
        return ac;
    }

    public void setAc(AirConditioner ac) {
        this.ac = ac;
    }

    public TV getTv() {
        return tv;
    }

    public void setTv(TV tv) {
        this.tv = tv;
    }
}
